<include file="Public:header" />

<link href="../Public/personal/css/message.css" rel="stylesheet" type="text/css" />
<link href="../Public/personal/css/person.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.upload_c{ width:187px; height:124px; border:1px solid #c6c6c6; background:#fafafa; margin:0 auto; text-align:center;}
.upload_c select{ width:162px; height:23px; line-height:23px; margin:23px 0 18px 0;}
.upload_btn{ background:../Public/personal/images/upload_bt.jpg no-repeat; width:157px; height:42px; border:none;}
</style>
<script language='JavaScript'>
function sendmsg(val,val2){
	 var Left=($(window).width()-$('#tid').width())/2;
	 var Top=($(window).height()-$('#tid').height())/2;　
	 $('#title').val("回复 "+val2);
	  $('#content').val("");
	 $('#tid').fadeIn().css({'top': Top, 'left': Left });
	 $('#tid form span').html("<input type='hidden' name='puid' id='puid' value='"+val+"'/>");
	 $('body').append("<div id='fade'></div>");
	 $("#fade").css({ "filter": "alpha(opacity=0)" }).fadeIn();
    
}

function quxiao()
{
	$(".tid").fadeOut(function(){
		$("#fade").remove();
		//window.location.href="{:U('Picture/upload')}";
	});
}
   
function fasong()
{
	var fuid=$('#puid').val(); var title=$('#title').val();var content=$('#content').val();
	$.post("{:U('Personal/send')}",{fuid:fuid,title:title,content:content},function(res){
		$("#tid").hide();
	    $("#fade").remove();
		if(res==1)  alert('发送成功');
		if(res==0)  alert('发送失败');
		if(res==2)  alert('标题或内容不能为空');
	});
}
</script>
<div class="content">
<div class="crumbs">当前位置：<a href="{:U('Personal/index')}">个人空间</a> > <a href="#">短消息</a></div>
<div class="w_content">
<div class="c_l">
<div class="c_lt">
<div class="per_info">
<eq name='basic.image' value=''><img src="__PUBLIC__/Uploads/PersonImage/per_img.jpg" />
<else/><img src="__PUBLIC__/Uploads/PersonImage/s_{$basic['image']}" width='84px' height='84px'/>
</eq>
<div class="pinfo">
<p class="pname">{$basic.nickname}</p>
<p class="plevel">等 级：{$basic.lname}</p>
<p class="pintegral">积 分：{$basic.score}分</p>
<a href="{:U('user/logout')}" ><input onclick="window.location.href='{:U('user/logout')}'" style="cursor:pointer;" type="button" value="退出系统" class="exit_btn"/></a>
</div>
<div class="clear"></div>
</div>
<ul>
<li class="resources"><a href="{:U('Personal/mysource')}">我的资源</a></li>
<li class="favorite"><a href="{:U('Personal/favorite')}">我的收藏夹</a></li>
<li class="edit">
<dl>
<dt>
<a href="{:U('Personal/basicinfo')}">编辑资料</a>
</dt>
<dd><a href="{:U('Personal/basicinfo')}">基本信息</a></dd>
<dd><a href="{:U('Personal/password')}">修改密码</a></dd>
<dd><a href="{:U('Personal/image')}" >修改头像</a></dd>
</dl>
</li>
<li class="friend"><a href="{:U('Personal/friend')}">我的好友</a></li>
<li class="message"><a href="{:U('Personal/message')}">短消息({$urcount}未读)</a></li>
</ul>
</div>
<div class="c_lb">
<div class="upload_c">
<select id="cate">
<option value="1">图片</option>
<option value="2">视频</option>
<option value="3">动画</option>
<option value="4">游戏</option>
<option value="5">文章</option>
<option value="6">挂图</option>
<option value="7">图书</option>
<option value="8">展品</option>
<option value="9">知识题</option>
</select>
<img src="../Public/personal/images/upload_bt.jpg" style="cursor:pointer;" onclick="upload();" />
</div>
</div>
</div>
<div class="c_m" style="margin: 5px 0 0 6px; width: 786px;">
<div class="c_mtab">
<p class="mtitle">{$msginfo.title}</span>
<p class="mname">发件人：{$msginfo.puname}</span>
<p class="mdate">日&nbsp;&nbsp;&nbsp;期：{$msginfo.ctime|date="Y-m-d",###}</span>
<p class="pmcontent"><span class="mctn">{$msginfo.content}</span></p>
<p><span class="reply_btn"><a href="javascript:void(0);" onclick="sendmsg('{$msginfo.puid}','{$msginfo.title}');">回 复</a></span>|<span class="delete_btn"><a href="{:U('Personal/message')}">返 回</a></span></p>
<div class="clear"></div>
</div>
</div>
<div class="clear"></div>
</div>
</div>
<div id='tid' class='tid'>
  <h3>发送短信息</h3>
  <span>&nbsp;</span>
   <form action="{:U('Personal/message')}" method='post'> 
   <span></span>
   <table align='center'>
      <tr><td width='50px' height='50px'>  标题：</td><td><input type='text' name='title' class='title' id='title'/></td></tr>
      <tr><td  width='50px' valign='top'> 内容：</td><td><textarea name='content' id='content' class='desc'></textarea></td></tr>
       <tr><td colspan='2' align='center'><input type='button' value='发 送' id='send' class='send' onclick="fasong();"/><input type='button' id='cancel' class='cancel' value='取消' onclick="quxiao();"/></td></tr>
     </table>
   </form>
 </div>
<script type="text/javascript">
function upload()
{
	var cate=$("#cate").val();

	switch (parseInt(cate))
	{
		case 1:window.location.href="{:U('Picture/upload')}";break;
		case 2:window.location.href="{:U('Video/upload')}";break;
		case 3:window.location.href="{:U('Flash/upload')}";break;
		case 4:window.location.href="{:U('Game/upload')}";break;
		case 5:window.location.href="{:U('Article/upload')}";break;
		case 6:window.location.href="{:U('Image/upload')}";break;
		case 7:window.location.href="{:U('Book/upload')}";break;
		case 8:window.location.href="{:U('Exhibits/upload')}";break;
		case 9:window.location.href="{:U('Knowledge/upload')}";break;
	}
}
</script>
<include file="Public:footer" />
